import request from '@/utils/request'

// crm 新建确认函
export function crmConfirmationSave(data) {
  return request({
    url: 'crm/confirmation/save',
    method: 'post',
    data: data
  })
}

// crm 列表
export function crmConfirmationIndex(data) {
  return request({
    url: 'crm/confirmation/index',
    method: 'post',
    data: data
  })
}


// 流转记账板块
export function roam(data) {
    return request({
      url: 'crm/wo/roam',
      method: 'post',
      data: data
    })
  }

// crm 更新
export function crmConfirmationUpdate(data) {
  return request({
    url: 'crm/confirmation/update',
    method: 'post',
    data: data
  })
}

// crm 删除
export function crmConfirmationDel(data) {
  return request({
    url: 'crm/confirmation/del',
    method: 'post',
    data: data
  })
}

// crm 详情
export function crmConfirmationRead(data) {
  return request({
    url: 'crm/confirmation/read',
    method: 'post',
    data: data
  })
}
/**
 * 查看类目
 * @param {*} data
 */
export function crmConfirmationReadCategory(data) {
  return request({
    url: 'crm/confirmation/readCategory',
    method: 'post',
    data: data
  })
}

/**
 * 新增类目
 * @param {*} data
 */
export function crmAddCategory(data) {
  return request({
    url: 'crm/confirmation/addCategory',
    method: 'post',
    data: data
  })
}

/**
 * 修改类目
 * @param {*} data
 */
export function crmUpdateCategory(data) {
  return request({
    url: 'crm/confirmation/updateCategory',
    method: 'post',
    data: data
  })
}

/**
 * 删除类目
 * @param {*} data
 */
export function crmDelCategory(data) {
  return request({
    url: 'crm/confirmation/delCategory',
    method: 'post',
    data: data
  })
}

/**
 * 类目排序
 * @param {*} data
 */
export function crmSortCategory(data) {
  return request({
    url: 'crm/confirmation/setOrderBy',
    method: 'post',
    data: data
  })
}

/**
 * 获取确认函字段
 * @param {*} product_id
 */
export function crmDataField(data) {
  return request({
    url: 'crm/confirmation/getDataByCheckedId',
    method: 'get',
    params: data
  })
}

/**
 * 获取确认函详情
 * @param {*} contract_id
 */
export function crmProductDetail(data) {
  return request({
    url: 'crm/contract_confirmation/read',
    method: 'get',
    params: data
  })
}

/**
 * 订单确认函修改
 * @param {*} data
 */
export function crmContractCategoryUpdate(data) {
  return request({
    url: 'crm/contract_confirmation/update',
    method: 'post',
    data: data
  })
}